{literal}
<script>
function irPara(dia, mes, ano)
{
	jqAjaxLink("{/literal}{$_site.url}{literal}agenda-sala/calendario?d="+dia+"&m="+mes+"&a="+ano, "", "div_calendario");
}

var dia = "{/literal}{$dia}{literal}";
var mes = "{/literal}{$mes}{literal}";
var ano = "{/literal}{$ano}{literal}";
var diaAtual = "{/literal}{$diaAtual}{literal}";
var mesAtual = "{/literal}{$mesAtual}{literal}";
var anoAtual = "{/literal}{$anoAtual}{literal}";
var classOver = "diaOver";
var classNorm = "diaNorm";
var classDown = " diaDown";
var classUp = " diaUp";
var classSel = " diaSel";
var classAtual = " diaAtual";
var classAgenda = " diaAgenda";
var temp = "";

$(document).ready(function () {
	$("#tblCal td.diaNorm").mouseover(function () {
		if ($(this).attr("title") != "") {
			temp = $(this).attr("class");
			$(this).attr("class", classOver);
		}
	});
	$("#tblCal td.diaNorm").mouseout(function () {
		if ($(this).attr("title") != "") {
			$(this).attr("class", temp);
		}
	});
	$("#tblCal td.diaNorm").mousedown(function () {
		if ($(this).attr("title") != "") $(this).attr("class", classDown);
	});
	$("#tblCal td.diaNorm").mouseup(function () {
		if ($(this).attr("title") != "") $(this).attr("class", classUp);
	});
	$("#tblCal td.diaNorm").click(function () {
		if ($(this).attr("title")!="")
		{
			irPara($(this).attr("title"),'{/literal}{$mes}{literal}', '{/literal}{$ano}{literal}');
		}
	});
	{/literal}{$script}{literal}
});
</script>
<style type="text/css">
.diaNorm {
	background-color: #EEEEFF;
	border-color: #ddd;
}
.diaOver {
	background-color: #ccc;
	border-color: #000;
}
.diaDown {
	color: #fff;
	background-color: #999;
	border-color: #f00;
}
.diaUp {
	color: #000;
	border-color: #000;
	background-color: #ccc;
}
.diaAgenda {
	background-color: #DFDFDF;
	/*background-color: #cfc;*/
}
.diaSel {
	color: #ffffff;
	background-color: #29506F;
	/*background-color: #ff9;*/
}
.diaAtual {
	color: #ffffff;
	background-color: #8EB9CF;
	/*background-color: #54859C;*/
	/*background-color: #BFCAFF;*/
}
.diaSemana {
	border: 1px solid #EFEFEF;
	/*background-color: #A7CCDF;*/
	
	/*color: #ffffff;
	background-color: #416477;
	background-color: #BFCAFF;*/
}
.mesAno  {
	color: #ffffff;
	background-color: #8EB9CF;
	/*background-color: #BFCAFF;*/
}
.mesAno a {
	color: #ffffff;
	background-color: #8EB9CF;
	/*background-color: #BFCAFF;*/
}
.mesAno a:hover {
	color: #54859C;
	background-color: #8EB9CF;
	/*background-color: #BFCAFF;*/
}
.legenda-texto {
	font-size: 10px;
}
.legenda-cor {
	border: 1px solid #000;
}
.borda-tabela {
	border: 1px solid #CCCCCC;
}
</style>
{/literal}

<table cellpadding="0" cellspacing="2" class="borda-tabela bold">
	
	<tr>
		<td align="center">
				<table id="tblCal" border='0' cellpadding="4" cellspacing="1">
					<tr>
						<td colspan="7" align="center" class="paddingTotal10 mesAno">&nbsp;<a href="#" onclick="irPara('1','{$mes}', '{$anoAnt}'); return false;">{$anoAnt} <img src="{$_site.url}public/images/ic-seta-anterior-ano.gif" alt="ano anterior" border="0" title="ano anterior"/>&nbsp;&nbsp;</a> <a href="#" onclick="irPara('1','{$mesAnt}', '{if $mesAnt eq 12}{$anoAnt}{else}{$ano}{/if}'); return false;">{$nomeMesAnt}&nbsp;<img src="{$_site.url}public/images/ic-seta-anterior-mes.gif" alt="mes anterior" border="0" title="mes anterior"/>&nbsp;&nbsp;</a> <b><big>{$nomeMes} {$ano}</big></b> <a href="#" onclick="irPara('1','{$mesPro}', '{if $mesPro eq 1}{$anoPro}{else}{$ano}{/if}'); return false;">&nbsp;&nbsp;<img src="{$_site.url}public/images/ic-seta-proximo-mes.gif" alt="proximo mes" border="0" title="proximo mes"/>&nbsp;{$nomeMesPro}</a> <a href="#" onclick="irPara('1','{$mes}', '{$anoPro}'); return false;">&nbsp;&nbsp;<img src="{$_site.url}public/images/ic-seta-proximo-ano.gif" alt="proximo ano" border="0" title="proximo ano"/> {$anoPro}</a></td>
					</tr>
					<tr height='20'>
						<td width='50' class="diaSemana" align="center"><b>dom</b></td>
						<td width='50' class="diaSemana" align="center"><b>seg</b></td>
						<td width='50' class="diaSemana" align="center"><b>ter</b></td>
						<td width='50' class="diaSemana" align="center"><b>qua</b></td>
						<td width='50' class="diaSemana" align="center"><b>qui</b></td>
						<td width='50' class="diaSemana" align="center"><b>sex</b></td>
						<td width='50' class="diaSemana" align="center"><b>s&aacute;b</b></td>
					</tr>
					<tr height='40'>
		{section name=i start=0 loop=6}
			{section name=j start=0 loop=7}
						<td height='40' valign="top" style="cursor:pointer;" class="diaNorm 
									{if $diaAtual eq $diasCalendario[$smarty.section.j.index][$smarty.section.i.index].dia and $mesAtual eq $mes and $anoAtual eq $ano}diaAtual{else}
									{if $dia eq $diasCalendario[$smarty.section.j.index][$smarty.section.i.index].dia}diaSel{else}
									{if $diasCalendario[$smarty.section.j.index][$smarty.section.i.index].agenda > 0}diaAgenda{/if}{/if}{/if}" title="{$diasCalendario[$smarty.section.j.index][$smarty.section.i.index].dia}">
							{if $diasCalendario[$smarty.section.j.index][$smarty.section.i.index].dia neq ""}<b>{/if}
							<p align="left" style="padding:0; margin:0; font-size: 10px; cursor:pointer;">{$diasCalendario[$smarty.section.j.index][$smarty.section.i.index].dia}</p>
							{if $diasCalendario[$smarty.section.j.index][$smarty.section.i.index].agenda > 0}
							<p align="center" style="padding:0; margin:0; font-size: 15px; cursor:pointer;">{$diasCalendario[$smarty.section.j.index][$smarty.section.i.index].agenda}</p>
							{/if}
						</td>
			{/section}
			{if $smarty.section.i.index lt 5}
					</tr>
					<tr height='40'>
			{/if}
		{/section}
					</tr>
				</table>
		</td>
	</tr>
	<tr>
	<td align="center" class="diaSemana ">
	<table cellpadding="2" cellspacing="2" >
		<tr>
		<td width="10" class="diaSel legenda-cor legenda-texto">&nbsp;</td>
		<td class="legenda-texto">Selecionado</td>
		<td width="10" class="diaAtual legenda-cor legenda-texto">&nbsp;</td>
		<td class="legenda-texto">Data atual</td>
		<td width="10" class="diaAgenda legenda-cor legenda-texto">&nbsp;</td>
		<td class="legenda-texto">Agendamento</td>
		</tr>
	</table>
	</td>
	</tr>
</table>
</td>
<td></td>
</tr>
</table>
